package com.ym.b2b.user.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ym.b2b.commons.controller.BaseController;
import com.ym.b2b.user.service.EmMPassPolicyService;
import com.ym.b2b.user.sqlbean.EmMPassPolicy;
import com.zc.commons.base.Result;

@Controller
@RequestMapping("/mpass")
public class ManagerEmMPassPolicyController extends BaseController {

    @Autowired
    private EmMPassPolicyService emMPassPolicyService;

    // 获取单条记录内容
    @RequestMapping("searchEmMPassPolicy.do")
    @ResponseBody
    public Result searchEmMPassPolicy(EmMPassPolicy emMPassPolicy, HttpServletRequest req) {
        Result result = new Result();
        try {
            result = emMPassPolicyService.searchEmMPassPolicy(emMPassPolicy);
        } catch (Exception e) {
            result.setCodeResult(Result.CODE_100, e.getMessage());
        }
        return result;
    }

    // 更新记录
    @RequestMapping("updateEmMPassPolicy.do")
    @ResponseBody
    public Result updateEmMPassPolicy(EmMPassPolicy emMPassPolicy, HttpServletRequest req) throws DataAccessException {
        Result result = new Result();
        result = emMPassPolicyService.updateEmMPassPolicy(emMPassPolicy);
        return result;
    }

}
